<template>
    <view class="address">
        <view class="address_text" @click="jumpAddress()">
            <view class="address_text_area flex">
                <view>
                    <text class="space">
                        {{ addressInfo.provinceName }}
                        {{ addressInfo.cityName }}
                        {{ addressInfo.areaName }}
                        {{ addressInfo.townName }}
                    </text>
                    <image class="icon_img" :src="getImgOssUrl('/ui-prod-2.0.0/icon_img05.png')" />
                </view>
                <view class="address_tip">距您944m</view>
            </view>
            <view class="address_text_address flex">
                <view> {{ addressInfo.street }} </view>
                <view> <uni-icons type="location-filled"></uni-icons></view>
            </view>
            <view class="address_business_hours flex">
                <view>营业时间：周一至周日 09:00-21:00</view>
                <uni-icons type="phone-filled"></uni-icons>
            </view>
        </view>
    </view>
</template>

<script setup>
import { getImgOssUrl } from '@/commons/utils.js';
import router from '@/router';

const props = defineProps({
    addressInfo: {
        type: Object,
        default: () => {
            return {};
        }
    }
});

const jumpAddress = () => {
    // router.push({
    //     path: '/pages-user/receiptAddress/list',
    //     query: {
    //         from: 'order'
    //     }
    // });
    // return;
};
</script>

<style lang="scss" scoped>
.address {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18rpx 0;
    padding: 29rpx 27rpx 29rpx 31rpx;
    color: #333333;
    background: #ffffff;

    .flex {
        display: flex;
        justify-content: space-between;
    }
    .space {
        margin-right: 22rpx;
    }
    .icon_img {
        width: 14rpx;
        height: 25rpx;
    }
    .address_text {
        width: 100%;
        .address_tip {
            font-size: 25rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #33302d;
        }
        .address_text_area {
            font-size: 29rpx;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #333333;
        }
        .address_text_address {
            margin: 29rpx 0;
            font-size: 25rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #333333;
        }
        .address_business_hours {
            font-size: 25rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #333333;
        }
    }

    .address_icon_img {
        width: 25rpx;
        height: 25rpx;
        image {
            width: 100%;
            height: 100%;
        }
    }
}
</style>
